package com.nancy.java_design.observer.demo2;

import java.util.Observable;

public class Thief extends Observable {

    private String name;

    public Thief(String name) {
        this.name = name;
    }

    public void steal() {

        // change设置为true，表示数据发生改变，否则不通知观察者
        setChanged();
        notifyObservers(name);
    }
}

